pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let orange_base: Vec<_> = num_str.chars().into_iter().collect();
    // println!("input: {num_str}, {to_base}");
    // 如果括号里的进制是一位数将会执行这个, 然后这一段是把num_str转换成对应的十进制表示。
    let num_oct: i32 = if *orange_base.last().unwrap() as u32 == unsafe { *orange_base.get_unchecked(orange_base.len() - 3) as u32 + 1 } {
        let o_base = orange_base[orange_base.len() - 2] as u32 - 48;
        let nmu_chat_tmp = &orange_base[..=orange_base.len()-4];
        nmu_chat_tmp.iter().rev().enumerate().map(|(i,c)|{ (*c as i32 - 48) * o_base.pow(i as u32) as i32}).sum()

    } else { // 两位数是这个。
        let a = &orange_base[orange_base.len()  - 3 ..=orange_base.len() - 2];
        let o_base = (a[0] as u32 - 48) * 10 + (a[1] as u32 - 48);
        let nmu_chat_tmp = &orange_base[..=orange_base.len()-5];
        nmu_chat_tmp.iter().rev().enumerate().map(|(i,c)|{ (*c as i32 - 48) * o_base.pow(i as u32) as i32}).sum()
    };
    let mut num_oct = num_oct as u32;
    // println!("Orange base: {}", num_oct);

    // 下面是把十进制表示转换成目标进制。

    let mut num: Vec<char> = Vec::new();
    while num_oct > 0 {
        let remainder = num_oct % to_base;
        num_oct /= to_base;
        match remainder {
            n if n <= 9 => {num.push((n + 48) as u8 as char);},
            n if n > 9 && n < 35 => {num.push((n as u8 + 87) as u8 as char);},
            _ => {panic!()}
        }
    }

    let a = num.into_iter().rev().collect::<String>();
    a

}
